package com._复习;

import java.util.Scanner;

public class Test04 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] arr1 = {19, 28, 37, 46, 50};
        System.out.println("请输入需要查找的数");
        int a = sc.nextInt();
        System.out.println( arr(arr1,a));
    }


    public static int arr(int[] arr1,int a) {
        for (int i = 0; i < arr1.length; i++) {
            if(arr1[i]==a){
                return i;
            }continue;
        }
        return -1;
    }
}




